home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-06 | 1.1 KB | 66 lines | [TEXT/MSET] |
- \ 25Dec93 DBH made font the superclass
- \ 28Oct94 dbh updated to 2.5 syntax
-
- (*
-
- A tebox is te with a black border. Note that the actual dimensions of
- the tebox are determined by the font, maximum number of characters to
- display on one line, and the maximum number of lines to display.
-
- *)
-
-
- :class tebox super{ te }
- graphicRect outline
- int #chars \ maximum # of chars we will display on one line
- int #lines \ maximum # of lines we will display
-
- :m move: { dx dy -- }
- dx dy move: super
- dx dy move: outline ;m
-
- :m moveto: { x y -- }
- x y moveto: super
- x y moveto: outline ;m
-
- :m init: ( #chars #lines -- )
- put: #lines
- put: #chars ;m
-
- :m classinit:
- 10 1 init: self
- 50 50 moveto: self
- ;m
-
- :m new: ( wptr -- )
- new: super
- lineheight: super \ font
- get: #lines * setheight: outline
- widmax: super \ font
- get: #chars 1+ * setwidth: outline
- get: outline setdest: super
- get: outline setview: super
- -1 -1 inset: outline
- ;m
-
- :m draw:
- draw: super
- draw: outline ;m
-
- ;class
-
- endload
-
- *** EXAMPLE USE
-
- selwindow w
- test: w
-
- tebox tb
- tb add: w
-
- tebox tb2
- 0 40 move: tb2
- tb2 add: w
-
-